<template>
  <div class="home">
      <van-button @click="btnClick">不要把</van-button>
      <van-button  @click="show = true">不要把</van-button>
      <div class="ddd">nihao </div>
      <van-action-sheet v-model="show" >
          <van-area :area-list="areaList" :value="value" title="选择地址" @confirm="confirm" />
      </van-action-sheet>

  </div>
</template>

<script>

import {fetch} from "@/api/home"
import { areaList } from '@/utils/area'

export default {
 data(){
   return{
       value: '150124',
       areaList: areaList,
       show: false,
   }
 },
  methods:{
    btnClick(){
      this.$router.push('/detail')
    },
    confirm(res) {
          console.log(res)
        this.show = false;
      }
  },
 mounted(){
     // console.log(this.$route.meta.base,'6666666')
   //发送请求
   fetch().then(res=>{
     console.log(res)
   }),
    console.log(this.$store.state.userinfo)
   //仓库更改值
   this.$store.commit('user', '可以')
   console.log(this.$store.state.userinfo)
   //设置cookie
   this.$Cookie.set('name', '11111111111111111', { expires: 7});
 }
}
</script>
<style  scoped lang="scss" >

  .ddd{
   background-color: $bg;
      color: $bs;
      font-size: $fontSize;
  }

</style>

